package com.example.administrator.nl.util;

import java.text.DecimalFormat;

/**
 * Created by yuanmengkai on 2019/9/1.
 */

public class DecimalFormatUtil {
    public static double format2(double number) {
        DecimalFormat df = new DecimalFormat("0.00");
        return Double.parseDouble(df.format(number));
    }

    public static float format2(float number) {
        DecimalFormat df = new DecimalFormat("0.00");
        return Float.parseFloat(df.format(number));
    }
}
